<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>修改成对标签中间的文字</title>
</head>
<body>
    <input type="button" value="点击效果" id="btn">
    <p id="content">I'm a label p.</p>

    <script>
    var bntObj = document.getElementById("btn");
    var pObj = document.getElementById("content");

    bntObj.onclick = function(){
        pObj.innerText = "I was changed by the button.";
    };


    
    </script>

</body>
</html>